<div class="modal-header dialog-header-confirm">
    <h4 class="modal-title text-center">
        <i class="fa fa-plus-square-o"></i>{{ 'permMgr.add.title' | translate}}
    </h4>
</div>
<div class="modal-body">
    <ng-form name="addPermDialog" novalidate role="form">
        <div class="form-group input-group-lg" ng-class="{true: 'has-error'}[addPermDialog.value.$dirty && addPermDialog.value.$invalid]">
            <label class="control-label" for="value" placeholder="{{ 'permMgr.value' | translate}}">{{ 'permMgr.value' | translate}}:</label>
            <input type="text" class="form-control" name="value" id="value" ng-model="perm.value">
            <label class="control-label" for="type" placeholder="{{ 'permMgr.permType' | translate}}">{{ 'permMgr.permType' | translate}}:</label>
            <br />
            <div id="type" class="btn-group" uib-dropdown is-open="permAddPermTypesDropdown.isOpen">
                <button type="button" class="btn btn-primary uib-dropdown-toggle" ng-disabled="disabled" uib-dropdown-toggle>
                    <span ng-bind="permAddPermTypesDropdown.option.type"></span>
                    <span class="caret"></span>
                </button>
                <ul uib-dropdown-menu role="menu" aria-labelledby="single-button">
                    <li ng-repeat="it in permAddPermTypesDropdown.items">
                        <a ng-click="permAddPermTypesDropdown.selectOption(it)" ng-bind="it.type"></a>
                    </li>
                </ul>
            </div>
            <br />
            <label class="control-label" for="valueExt" placeholder="{{ 'permMgr.eavValue' | translate}}">{{ 'permMgr.eavValue' | translate}}:</label>
            
            <input type="text" class="form-control common-hidden {{(permAddPermTypesDropdown && (permAddPermTypesDropdown.option.type == 'URI_PATTERN'  
            || permAddPermTypesDropdown.option.type == 'REGULAR_PATTERN'))?'':'no'}}"  name="valueExt" id="valueExt" ng-model="perm.valueExt">
            <div class="common-hidden {{(permAddPermTypesDropdown && (permAddPermTypesDropdown.option.type != 'URI_PATTERN'  && permAddPermTypesDropdown.option.type != 'REGULAR_PATTERN'))?'':'no'}}">
                <div id="valueExtDropDown" class="btn-group" uib-dropdown is-open="permAddPermValueExtDropdown.isOpen">
                    <button type="button" class="btn btn-primary" ng-disabled="disabled" uib-dropdown-toggle>
                        <span ng-bind="permAddPermValueExtDropdown.option"></span>
                        <span class="caret"></span>
                    </button>
                    <ul uib-dropdown-menu role="menu" aria-labelledby="single-button">
                        <li ng-repeat="it in permAddPermValueExtDropdown.items">
                            <a ng-click="permAddPermValueExtDropdown.selectOption(it)" ng-bind="it"></a>
                        </li>
                    </ul>
                </div>
            </div>

            <label class="control-label" for="description" placeholder="{{ 'permMgr.permDesc' | translate}}">{{ 'permMgr.permDesc' | translate}}:</label>
            <textarea style="height:120px;" id="description" name="description" class="form-control" placeholder="{{ 'permMgr.permDesc' | translate}}" ng-model="perm.description"></textarea>
            <br />
            <span class="text-danger"><strong>{{msg}}</strong></span>
        </div>
    </ng-form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" ng-click="cancel()">{{ 'dialog.cancel' | translate}}</button>
    <button type="button" class="btn btn-primary" ng-click="save()"
            ng-disabled="(addPermDialog.$dirty && addPermDialog.$invalid) || addPermDialog.$pristine">{{ 'dialog.save' | translate}}</button>
</div>
